<template>
	<view class="Jy_shop_detail_page">
		<view class="Jy_shop_detail_container">
			<view class="Jy_shop_detail_head_group"
				:style="[{ 'padding-top': statusBarHeight + 'px' }, { 'background-color': backColor }]">
				<view class="Jy_shop_detail_head_box">
					<view class="back_icon_box" @click="getBack()">
						<u-icon name="arrow-left" color="#000000" size="20"></u-icon>
					</view>
					<view class="pg_title_group">
						<view class="pg_title_box" :style="{ opacity: opacity }"><text>商品详情</text></view>
					</view>
				</view>
			</view>
			<view class="Jy_shop_detail_swiper_group">
				<swiper class="swiper" :indicator-dots="true" :autoplay="true" :interval="3000" :duration="300"
					circular="true">
					<swiper-item v-for="(item, index) in sliderImage" :key="index">
						<view class="swiper-item">
							<image :src="item" mode="aspectFill">
							</image>
						</view>
					</swiper-item>
				</swiper>
			</view>

			<view class="shop_detail_content_group">

				<view class="detail_active_group" v-if="activityH5.length > 0">
					<view class="" v-for="(item,index) in activityH5">
						<view class="detail_active_top_box">
							<view class="left" v-if="item.type == '1'">
								<text>参与秒杀</text>
							</view>
							<view class="left" v-if="item.type == '2'">
								<text>参与拼团</text>
							</view>
							<view class="left" v-if="item.type == '3'">
								<text>参与砍价</text>
							</view>

							<view class="right_text">
								<text>参与活动 优惠享不停</text>
							</view>
						</view>
					</view>
					<view class="detail_active_bottom_group">
						<view class="time_down_text_box">
							<!-- <text>距离本商品活动结束还剩{{}}</text> -->
						</view>
					</view>
				</view>

				<view class="detail_basic_info_group">
					<view class="detail_basic_info_box">
						<view class="price_box">
							<text class="symbal">￥</text>
							<text class="size">{{productInfo.price}}</text>
						</view>
						<view class="shop_detail_name_box">
							<text class="active_tags"
								v-if="activityH5.length > 0 && activityH5[0].type === '1' ">秒杀</text>
							<text class="active_tags"
								v-if="activityH5.length > 0 && activityH5[0].type === '2' ">拼团</text>
							<text class="active_tags"
								v-if="activityH5.length > 0 && activityH5[0].type === '3' ">砍价</text>
							<text class="shop_name">{{productInfo.storeName}}</text>
						</view>
						<view class="xs_numner_group">
							<view class="xs-text-box">
								<text>英郎</text>
							</view>
							<view class="xs-number-box">
								<text>月销</text>
								<text class="number">{{productInfo.ficti}}</text>
							</view>
						</view>
						<view class="sale_button_group">
							<!-- 分享按钮 -->
							<view class="sale_button_box" @click="">
								<view class="sale_image_box">
									<image src="http://120.78.177.187:8083/crmebimage/public/mpImage/detail/sale.png" mode="aspectFill"></image>
								</view>
								<view class="sale_text_box">
									<text>分享</text>
								</view>
							</view>
						</view>
					</view>
				</view>

				<!-- 选择产品参数 -->
				<view class="Jy_select_parameters_group">
					<view class="ok_select_parame_group" @click="getParamsOption()">
						<view class="text_box">
							<text>{{attrTxt}}</text>
						</view>
						<view class="select_parameter_box">
							<text>{{attrValue}}</text>
						</view>
						<view class="right_icon_box">
							<u-icon name="arrow-right" color="#000000" size="14"></u-icon>
						</view>
					</view>
					<view class="parameter_group">
						<view class="image_parameter_list_group">
							<view class="image_parameter_list" v-for="(item, index) in productValue" :key="index">
								<view class="image_parameter_image_box">
									<!-- <text>{{item.suk}}</text> -->
									<!-- <text>库存：{{item.stock}}</text> -->
									<!-- <image src="" mode="aspectFill"></image> -->
								</view>
							</view>
						</view>
						<view class="total_parameter_box">
							<text>共{{productValueSize}}中规格可选</text>
						</view>
					</view>
				</view>


				<!-- 拼团公告栏 谁拼团成功 -->
				<view class="" v-if="activityH5.length > 0 && activityH5[0].type === '2' ">
					<view class="announcement_board_group">
						<view class="announcement_board_box">
							<view class="naiba_icon_box">
								<u-icon name="volume" color="#f83600" size="18"></u-icon>
							</view>
							<view class="ping_number_box">
								<text>已拼</text>
								<text>2</text>
								<text>件</text>
							</view>
							<view class="annmoun_swiper_group">
								<swiper class="swiper" :indicator-dots="false" :autoplay="true" :interval="3000"
									:duration="300" vertical="true" circular="true">
									<swiper-item v-for="(item, index) in 2" :key="index">
										<view class="swiper-item">{{index}}拼团成功</view>
									</swiper-item>
								</swiper>
							</view>
						</view>
					</view>

					<!-- 拼团玩法 -->
					<view class="playing_method_group">
						<view class="playing_method_container">
							<view class="playing_method_title_box">
								<text>拼团玩法</text>
							</view>
							<view class="playing_method_content_group">
								<view class="bz_content_box">
									<view class="bz_number_box">
										<text>1</text>
									</view>
									<view class="bx_text_box">
										<text>开团/参团</text>
									</view>
								</view>
								<view class="arro_right_image_box">
									<image src="http://120.78.177.187:8083/crmebimage/public/mpImage/detail/arrow_right.png" mode="aspectFill"></image>
								</view>
								<view class="bz_content_box">
									<view class="bz_number_box">
										<text>2</text>
									</view>
									<view class="bx_text_box">
										<text>邀请好友</text>
									</view>
								</view>
								<view class="arro_right_image_box">
									<image src="http://120.78.177.187:8083/crmebimage/public/mpImage/detail/arrow_right.png" mode="aspectFill"></image>
								</view>
								<view class="bz_content_box">
									<view class="bz_number_box">
										<text>3</text>
									</view>
									<view class="bx_text_box">
										<text>满员发货</text>
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>


				<!-- 优品推荐 适用于普通商品 -->
				<view class="preferred_recommendation_group" v-if="good_list.length > 0">
					<view class="preferred_recommendation_box">
						<view class="preferred_recommendation_title_box">
							<text>优品推荐</text>
						</view>
						<view class="preferred_recommendation_list_group">
							<view class="preferred_recommendation_list" v-for="(item, index) in good_list" :key="index"
								@click="goShoppingDetail(item)">
								<view class="preferred_recommendation_container">
									<view class="preferred_recommendation_image_box">
										<image :src="item.image" mode="aspectFill"></image>
									</view>
									<view class="preferred_recommendation_name_box">
										<text>{{item.storeName}}</text>
									</view>
									<view class="preferred_recommendation_price_box">
										<text>￥</text>
										<text>{{item.price}}</text>
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>

				<!-- 评价中心 -->
				<view class="Jy_evaluation_enter_group">
					<view class="Jy_evaluation_enter_title_group">
						<view class="left_text_box">
							<text>用户评价</text>
							<text class="number">({{replyCount}})</text>
						</view>
						<view class="right_good_evaluation_group">
							<view class="evaluation_text_box">
								<text>好评</text>
								<text class="luve_box">{{replyChance || 0}}%</text>
							</view>
							<view class="right_icon_box">
								<u-icon name="arrow-right" color="#000000" size="14"></u-icon>
							</view>
						</view>
					</view>
					<view class="Jy_evaluation_enter_list_group" v-if="reply.length > 0">
						<view class="Jy_evaluation_enter_list" v-for="(item, index) in reply" :key="index">
							<view class="user_head_image_box">
								<image src="http://120.78.177.187:8083/crmebimage/public/mpImage/address/default.png" mode=""></image>
							</view>
							<view class="user_basic_info_group">
								<view class="user_basic_info_container">
									<view class="user_send_eavl_group">
										<view class="user_basic_info_box">
											<view class="name_box">
												<text>用户名称</text>
											</view>
											<view class="star_number_box">
												<u-rate :count="scoreCount" active-color="#ff7500" v-model="scoreValue"
													readonly gutter="1" size="15"></u-rate>
											</view>
										</view>
										<view class="timer_box">
											<text>2021-3-3 11:30:22</text>
										</view>
									</view>
									<view class="guige_box">
										<text>规格:</text>
										<text class="color">【新品】红色</text>
									</view>
								</view>
								<view class="user_message_box">
									<text>这是一条用户评论的消息</text>
								</view>
								<view class="user_sai_image_group">
									<!-- 用户晒图 -->
									<view class="user_sai_image_list" v-for="(item, index) in reply" :key="index">
										<view class="user_sai_image_container">
											<image src="http://120.78.177.187:8083/crmebimage/public/mpImage/home/logo.png" mode="aspectFill"></image>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>

				<!-- 商品详情 -->
				<view class="shop_detail_image-group">
					<view class="shop_detail_title_box">
						<view class="image_box">
							<image :src="detailTitleImage" mode="widthFix"></image>
						</view>
					</view>
					<view class="showPic">
						<view class="detail_html" style="font-size: 0" v-html="productInfo.content"></view>
						<!-- <image src="https://img95.699pic.com/photo/50088/5720.jpg_wh860.jpg" mode="widthFix"></image> -->
					</view>
				</view>
			</view>

			<!-- 规格尺寸弹框 -->
			<u-popup :show="parmaShow" @close="parmaClose" @open="parmaOpen" :closeable="true" closeIconPos="top-right">
				<view class="params_group">
					<view class="shop_info_group">
						<view class="shop_info_container">
							<view class="shop_image_box">
								<image :src="productInfo.image" mode="aspectFill"></image>
							</view>
							<view class="shop_basic_info_group">
								<view class="s_name_box">
									<text>{{productInfo.storeName}}</text>
								</view>
								<view class="s_price_box">
									<text class="smyal">￥</text>
									<text class="number">{{productInfo.price}}</text>
								</view>
								<view class="s_number_box">
									<text>库存:</text>
									<text>{{productInfo.stock}}</text>
								</view>
							</view>
						</view>
					</view>
					<view class="parma_list" v-for="(item, index) in attr.productAttr" :key="index">
						<view class="parma_name_box">
							<text>{{item.attrName}}</text>
						</view>
						<view class="parma_small_group">
							<view class="parma_small_list" v-for="(jitem, jindex) in item.attrValues" :key="jindex"
								@click="tapAttr(index,jindex)">
								<view :class="[item.index === jitem ? 'active' : '', 'parma_small_container']">
									<text>{{jitem}}</text>
								</view>
							</view>
						</view>
					</view>
					<view class="parma_number_group">
						<view class="parma_number_text_box">
							<text>数量</text>
						</view>
						<view class="parma_small_number_box">
							<u-number-box v-model="shoppingNumberValue" @change="ChangeCartNum">
							</u-number-box>
						</view>
					</view>
				</view>
			</u-popup>


		</view>

		<view class="detail_tabbar_group">
			<view class="detail_tabbar_box">
				<view class="left_small_icon_group">
					<view class="couster_service_group" @click="">
						<view class="couster_icon_box">
							<image src="http://120.78.177.187:8083/crmebimage/public/mpImage/detail/cousterservice.png" mode="aspectFill"></image>
						</view>
						<view class="couster_text_box">
							<text>客服</text>
						</view>
					</view>
					<view class="collection_group" @click="collectAdd()">
						<view class="collection_icon_box">
							<image src="http://120.78.177.187:8083/crmebimage/public/mpImage/detail/collection1.png" mode="aspectFill" v-if="userCollect">
							</image>
						</view>
						<view class="collection_text_box">
							<text>收藏</text>
						</view>
					</view>
					<view class="collection_group" @click="goCar">
						<view class="collection_icon_box">
							<image src="http://120.78.177.187:8083/crmebimage/public/mpImage/detail/shoppringcart.png" mode="aspectFill"></image>
						</view>
						<view class="collection_text_box">
							<text>购物车</text>
						</view>
					</view>
				</view>
				<view class="right_buy_tabbar_box">
					<view class="right_buy_tabbar_container">
						<view class="add_cart_button_box" @click="goCat(1)">
							<text>加入购物车</text>
						</view>
						<view class="gou_button_box" @click="goCat(0)">
							<text>立即购买</text>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// 适配头部导航高度
				statusBarHeight: getApp().globalData.statusBarHeight,
				backColor: 'rgba(255, 255, 255, 0)',
				opacity: '0',
				// 评分总共多少等级 
				scoreCount: 5,
				scoreValue: 2,
				// 商品导航栏背景 
				detailTitleImage: this.$mAssetsPath.detailTitleImage,
				productId: '',
				productDetail: {},
				sliderImage: [],
				productInfo: {},
				activityH5: [],
				productValue: [], //系统属性
				attr: {
					cartAttr: false,
					productAttr: [],
					productSelect: {}
				},
				good_list: [],
				replyCount: 0, //总评论数量
				reply: [], //评论列表
				replyChance: 0,
				// 参数选项框
				parmaShow: false,
				// 商品参数步进器的值
				shoppingNumberValue: 1,
				productValueSize: 0,
				userCollect: false,
				attrValue: '',
				attrTxt: '',
				cart_num: 1, //购买数量

			};
		},
		onPageScroll(res) {
			this.getPageScroll(res);
		},
		onLoad(option) {
			this.productId = option.productId;
			if (option.productId) {
				this.getShoppongDetail(option.productId);
				this.getrepy(option.productId);
			}
			this.getGood();

		},
		methods: {

			goCar() {
				uni.switchTab({
					url: '../main/customerShoppingCart/customerShoppingCart'
				})
			},

			/*
			 * 加入购物车
			 */
			goCat(num) {
				let that = this,
					productSelect = that.productValue[this.attrValue];
				//打开属性
				if (that.attrValue) {
					//默认选中了属性，但是没有打开过属性弹窗还是自动打开让用户查看默认选中的属性 this.parmaShow = true;
					that.attr.cartAttr = !that.parmaShow ? true : false;
				} else {
					if (that.parmaShow) that.attr.cartAttr = true;
					else that.attr.cartAttr = !that.attr.cartAttr;
				}
				//只有关闭属性弹窗时进行加入购物车
				if (that.attr.cartAttr === true && that.parmaShow === false)
					return (that.parmaShow = true);
				//如果有属性,没有选择,提示用户选择
				if (
					that.attr.productAttr.length &&
					productSelect.stock === 0 &&
					that.parmaShow === true
				)
					return that.$util.Tips({
						title: "产品库存不足，请选择其它"
					});
				if (num === 1) {
					let data = {
						productId: parseFloat(that.productId),
						cartNum: parseFloat(that.attr.productSelect.cart_num),
						isNew: false,
						productAttrUnique: that.attr.productSelect !== undefined ?
							that.attr.productSelect.unique : that.productInfo.id
					};
					this.sendRequest({
						url: "/api/front/cart/save",
						data: data,
						method: 'post',
						success: res => {
							that.parmaShow = false;
							that.attr.cartAttr = false;
						}
					})

				} else {
					this.getPreOrder();
				}
			},

			/**
			 * 预下单
			 */
			getPreOrder() {
				let data = {
					preOrderType: 'buyNow',
					orderDetails: [{
						"attrValueId": parseFloat(this.attr.productSelect.unique),
						"productId": parseFloat(this.productId),
						"productNum": parseFloat(this.attr.productSelect.cart_num)
					}]
				};
				this.sendRequest({
					url: "/api/front/order/pre/order",
					data: data,
					method: 'post',
					success: res => {
						uni.navigateTo({
							url: '/pages/paymentMethod/paymentMethod'
						})
					}
				})
				// this.$Order.getPreOrder(this.type === 'normal' ? 'buyNow' : 'video', [{
				// 	"attrValueId": parseFloat(this.attr.productSelect.unique),
				// 	"productId": parseFloat(this.id),
				// 	"productNum": parseFloat(this.attr.productSelect.cart_num)
				// }]);
			},
			/**
			 * 购物车数量加和数量减
			 * 
			 */
			ChangeCartNum(changeValue) {
				//获取当前变动属性
				let productSelect = this.productValue[this.attrValue];
				//如果没有属性,赋值给商品默认库存
				if (productSelect === undefined && !this.attr.productAttr.length)
					productSelect = this.attr.productSelect;
				//无属性值即库存为0；不存在加减；
				if (productSelect === undefined) return;
				let stock = productSelect.stock || 0;
				let num = this.attr.productSelect;
				if (changeValue) {
					num.cart_num = changeValue.value;
					if (num.cart_num > stock) {
						this.$set(this.attr.productSelect, "cart_num", stock);
						this.$set(this, "cart_num", stock);
					} else {
						this.$set(this.attr.productSelect, "cart_num", changeValue.value);
					}
				}
			},
			// 修改规格值
			tapAttr(indexw, indexn) {
				let that = this;
				that.attrVal({
					indexw: indexw,
					indexn: indexn
				});

				this.$set(this.attr.productAttr[indexw], 'index', this.attr.productAttr[indexw].attrValues[indexn]);
				let value = that
					.getCheckedValue()
					// .sort()
					.join(",");
				that.ChangeAttr(value);

			},
			attrVal(val) {
				this.$set(this.attr.productAttr[val.indexw], 'index', this.attr.productAttr[val.indexw].attrValues[val
					.indexn]);
			},
			//获取被选中属性；
			getCheckedValue() {
				let productAttr = this.attr.productAttr;
				let value = [];
				for (let i = 0; i < productAttr.length; i++) {
					for (let j = 0; j < productAttr[i].attrValues.length; j++) {
						if (productAttr[i].index === productAttr[i].attrValues[j]) {
							value.push(productAttr[i].attrValues[j]);
						}
					}
				}
				return value;
			},

			/**
			 * 属性变动赋值
			 * 
			 */
			ChangeAttr(res) {

				let productSelect = this.productValue[res];
				if (productSelect) {
					this.$set(this.attr.productSelect, "image", productSelect.image);
					this.$set(this.attr.productSelect, "price", productSelect.price);
					this.$set(this.attr.productSelect, "stock", productSelect.stock);
					this.$set(this.attr.productSelect, "unique", productSelect.id);
					this.$set(this.attr.productSelect, "cart_num", 1);
					this.$set(this, "attrValue", res);
					this.$set(this, "attrTxt", "已选择");
				} else {
					this.$set(this.attr.productSelect, "image", this.productInfo.image);
					this.$set(this.attr.productSelect, "price", this.productInfo.price);
					this.$set(this.attr.productSelect, "stock", 0);
					this.$set(this.attr.productSelect, "unique", this.productInfo.id);
					this.$set(this.attr.productSelect, "cart_num", 1);
					this.$set(this, "attrValue", "");
					this.$set(this, "attrTxt", "请选择");
				}
			},

			DefaultSelect() {
				let productAttr = this.attr.productAttr;
				let value = [];
				for (let key in this.productValue) {
					if (this.productValue[key].stock > 0) {
						value = this.attr.productAttr.length ? key.split(",") : [];
						break;
					}
				}
				for (let i = 0; i < productAttr.length; i++) {
					this.$set(productAttr[i], "index", value[i]);
				}
				//sort();排序函数:数字-英文-汉字；
				let productSelect = this.productValue[value.join(",")];
				if (productSelect && productAttr.length) {
					this.$set(
						this.attr.productSelect,
						"storeName",
						this.productInfo.storeName
					);
					this.$set(this.attr.productSelect, "image", productSelect.image);
					this.$set(this.attr.productSelect, "price", productSelect.price);
					this.$set(this.attr.productSelect, "stock", productSelect.stock);
					this.$set(this.attr.productSelect, "unique", productSelect.id);
					this.$set(this.attr.productSelect, "cart_num", 1);
					this.$set(this, "attrValue", value.join(","));
					this.$set(this, "attrTxt", "已选择");
				} else if (!productSelect && productAttr.length) {
					this.$set(
						this.attr.productSelect,
						"storeName",
						this.productInfo.storeName
					);
					this.$set(this.attr.productSelect, "image", this.productInfo.image);
					this.$set(this.attr.productSelect, "price", this.productInfo.price);
					this.$set(this.attr.productSelect, "stock", 0);
					this.$set(this.attr.productSelect, "unique", this.productInfo.id);
					this.$set(this.attr.productSelect, "cart_num", 1);
					this.$set(this, "attrValue", "");
					this.$set(this, "attrTxt", "请选择");
				} else if (!productSelect && !productAttr.length) {
					this.$set(
						this.attr.productSelect,
						"storeName",
						this.productInfo.storeName
					);
					this.$set(this.attr.productSelect, "image", this.productInfo.image);
					this.$set(this.attr.productSelect, "price", this.productInfo.price);
					this.$set(this.attr.productSelect, "stock", this.productInfo.stock);
					this.$set(
						this.attr.productSelect,
						"unique",
						this.productInfo.id || ""
					);
					this.$set(this.attr.productSelect, "cart_num", 1);
					this.$set(this, "attrValue", "");
					this.$set(this, "attrTxt", "请选择");
				}
			},

			// addCard() {
			// 	let data = {}

			// 	this.sendRequest({
			// 		url: "/api/front/cart/save",
			// 		data: data,
			// 		success: res => {
			// 			if (res.data.data.list) {
			// 				let reply = res.data.data.list || [];
			// 				this.$set(this, 'reply', reply);
			// 			}
			// 		}
			// 	})
			// },
			goShoppingDetail(item) {
				uni.navigateTo({
					url: '/pages/shoppingDetail/shoppingDetail?productId=' + item.id
				})
			},
			// 评论
			getrepy(productId) {
				let data = {
					"noAuth": true
				}
				this.sendRequest({
					url: "/api/front/reply/product/" + productId,
					data: data,
					success: res => {
						if (res.data.data.list) {
							let reply = res.data.data.list || [];
							this.$set(this, 'reply', reply);
						}
					}
				})

				this.sendRequest({
					url: "/api/front/reply/config/" + productId,
					data: data,
					success: res => {
						if (res.data.data) {
							this.$set(this, 'replyChance', res.data.data.replyChance * 100);
							this.$set(this, 'replyCount', res.data.data.sumCount);
						}
					}
				})
			},

			// 优品推荐
			getGood() {
				this.sendRequest({
					url: "/api/front/product/good",
					success: res => {
						if (res.data.data.list) {
							let good_list = res.data.data.list || [];
							this.$set(this, 'good_list', good_list);
						}
					}
				})
			},

			// 优品推荐
			collectAdd() {
				let data = {}
				data.category = "product";
				data.id = this.productId;
				this.sendRequest({
					url: "/api/front/collect/add",
					data: data,
					method: 'post',
					success: res => {

					}
				})
			},

			// 商品详情
			getShoppongDetail(productId) {
				let data = {
					"type": "normal",
				}
				let that = this;
				// 获取商品
				this.sendRequest({
					url: "/api/front/product/detail/" + productId,
					data: data,
					success: res => {
						if (res.data.data) {
							that.productDetail = res.data.data;
							let productInfo = res.data.data.productInfo;
							// 字符串数组转数组；
							let arrayImg = productInfo.sliderImage;
							this.sliderImage = JSON.parse(arrayImg);
							that.$set(that, 'productInfo', productInfo);
							that.$set(that.attr, 'productAttr', res.data.data.productAttr);
							that.$set(that, 'productValue', res.data.data.productValue);
							that.$set(that, 'userCollect', res.data.data.userCollect);
							that.$set(that, 'productValueSize', res.data.data.productValueSize);
							that.$set(that, 'activityH5', res.data.data.activityAllH5 ? res.data.data
								.activityAllH5 : []);
							let productAttr = this.attr.productAttr.map(item => {
								return {
									attrName: item.attrName,
									attrValues: item.attrValues.split(','),
									id: item.id,
									isDel: item.isDel,
									productId: item.productId,
									type: item.type
								}
							});
							this.$set(this.attr, 'productAttr', productAttr);
							this.DefaultSelect();
						}
					}
				})
			},

			// 返回上一页
			getBack() {
				uni.navigateBack();
			},
			getPageScroll(res) {
				//获取距离顶部距离
				const scrollTop = res.scrollTop;
				if (scrollTop >= 0) {
					// 导航条颜色透明渐变
					if (scrollTop <= 20) {
						this.backColor = 'rgba(255, 255, 255, 0)';
						this.opacity = '0';
					} else if (20 < scrollTop && scrollTop <= 100) {
						this.backColor = 'rgba(255, 255, 255, .5)';
						this.opacity = '.5';
					} else if (scrollTop > 100) {
						this.backColor = 'rgba(255, 255, 255, 1)';
						this.opacity = '1';
					}
				}
			},
			// 点击立即购买
			goBuy() {
				this.parmaShow = true;
				let count = 1;
				count++;
				// 模拟点击两次,第一次判断用户是否选参数,如果没选,弹出参数选项框,选了直接跳转到支付页面
				if (count >= 2) {
					uni.navigateTo({
						url: '/pages/paymentMethod/paymentMethod'
					})
				}
			},
			// 参数选择弹框打开
			parmaOpen() {

			},
			// 参数选择弹框关闭
			parmaClose() {
				this.parmaShow = false;
			},
			// 步进器的值发生改变
			shoppingNumberValChange(e) {
				console.log('当前值为: ' + e.value)
				console.log('当前值为1: ' + e.name)
			},
			getParamsOption() {
				this.parmaShow = true;
			}
		}
	};
</script>

<style lang="scss" scoped>
	@import 'shoppingDetail.scss';
</style>
